package easy;

import java.io.*;

public class MixedContent {

	public static void main(String[] args) {
		File file = new File(args[0]);
		BufferedReader in;
		try {
			in = new BufferedReader(new FileReader(file));
			String line;
			while ((line = in.readLine()) != null) {
				changeOrder(line);
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		
	}

	public static void changeOrder(String str) {
		String[] strArray = str.split(",");
		String num = "", words = "", output = "";
		
		for (int i = 0; i < strArray.length; i++) {
			try {
				num += Integer.parseInt(strArray[i]) + ",";
			} catch (Exception e) {
				words += strArray[i] + ",";
			}
		}
		if(words.length() > 0) {
			words = words.substring(0, words.length() - 1);
		}
		if(num.length() > 0) {
			num = num.substring(0, num.length() - 1);
		}
		if(words.length() < 1)
			output = num;
		else if (num.length() < 1)
			output = words;
		else
			output = words + "|" + num;

		System.out.println(output);
	}
}
